const { checkClassDir, checkUserFile, saveFile } = require("./upload.js")
const { getProjectList, checkClassDirExists} = require("./list.js")
const { getClassList } = require("./classies.js")

const fs = require('fs')
const path = require('path')

// 首页渲染
const renderIndex = async (ctx) => {
    const indexFile = path.join(process.cwd(), 'dist', 'index.html');
    ctx.body = fs.createReadStream(indexFile)
}


// 导出
module.exports = {
    renderIndex,
    checkClassDir,
    checkUserFile,
    saveFile,
    getProjectList,
    checkClassDirExists,
    getClassList
}